﻿using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Text;

namespace math.test.NebAddr

{
    public class NebAddrTest1
    {
        [Test]
        public void Test1()
        {
            byte[] prikey = new byte[32];
            JustMathCore.HexTool.Hexstr2Bytes("ea00e3419fd7d6c53a065f22734c032731fb64be85d15dee77500a01a9939a9f", prikey);

            //Roll.Roll32.Roll32_Go(5, prikey);
            var wif = JustMathCore.AddrTools.neb.GetWif(prikey);


            Console.WriteLine("wif=" + wif);
            JustMathCore.Hex160 hex = JustMathCore.AddrTools.neb.GetHashAddr(prikey);
            Console.WriteLine("hashaddr=" + hex.Format());
            var addr = JustMathCore.AddrTools.neb.GetAddr(prikey);
            Console.WriteLine("addr=" + addr);

            JustMathCore.Hex160 hex3 = JustMathCore.AddrTools.neb.Addr2Hash(addr);
            Console.WriteLine("hexfromaddr=" + hex3.Format());
            var addr3 = JustMathCore.AddrTools.neb.Hash2Addr(hex3);
            Console.WriteLine("addrfromhex=" + addr3);

            Assert.IsTrue(addr3 == addr);

            Assert.Pass();
        }
    }
}
